package strategy.improve;

import strategy.improve.behavior.fly.GoodFlyBehavior;
import strategy.improve.behavior.run.GoodRunBehavior;
import strategy.improve.behavior.swim.GoodSwimBehavior;

public class GreenDuck extends Duck {
    // 构造方法中指定具体行为，不指定则默认空行为
    public GreenDuck() {
        super.runBehavior = new GoodRunBehavior();
        super.swimBehavior = new GoodSwimBehavior();
        super.flyBehavior = new GoodFlyBehavior();
    }

    public void fly() {
        System.out.print("我是绿色鸭子，");
        super.fly();
    }

    @Override
    public void display() {
        System.out.println("我是绿色鸭子~");
    }
}
